Methods, devices, and systems for diagnosing contaminants in drilling fluid

ABSTRACT

A drilling fluid manager receives measurements of drilling fluid data over a period of time. The drilling fluid manager analyzes the time-series drilling fluid data to diagnose a contaminant type, contaminant concentration, and a rate of change of contaminant concentration. The drilling fluid manager develops a treatment plan with a treatment type, a treatment mass, and a treatment schedule for the contaminant type.

CROSS-REFERENCE TO RELATED APPLICATIONS

The subject disclosure claims priority from U.S. Provisional Appl. No. 63/362,575, filed on Apr. 6, 2022, entitled “METHODS, DEVICES, AND SYSTEMS FOR DIAGNOSING CONTAMINANTS IN DRILLING FLUID,” herein incorporated by reference in its entirety.

BACKGROUND

Downhole drilling often involves degrading a formation by rotating a drill bit against a formation at the bottom of a wellbore. Drilling fluid, or drilling mud, is often circulated through the wellbore from a mud pit on the surface to the drill bit. The drilling fluid may cool the drill bit, collect the cuttings generated by the drill bit, and carry the cuttings to the surface. The formula of a drilling fluid is often engineered to have particular properties, such as shear strength, density, viscosity, and so forth. These properties relate to the drilling effectiveness drilling operation. As the drilling fluid collects the cuttings and interacts with the formation, contaminants may be introduced into the drilling fluid, thereby causing the properties of the drilling fluid to be altered. This may result in a reduced effectiveness of the drilling operation, which may result in damage to the downhole drilling assembly.

Conventionally, as the drilling fluid circulates back to the surface, a drilling fluid engineer may provide additives to the drilling fluid to counteract the contaminants and maintain the drilling fluid properties within a setpoint of target drilling fluid properties. The drilling fluid engineer typically directly manages analysis of the properties of the returned fluid. For example, the drilling fluid engineer may collect samples of and perform field tests on the drilling fluid. Using the results of a single field test, the drilling fluid engineer may attempt to identify one or more contaminants in the drilling fluid. But such methods are slow and inaccurate, often resulting in mis-identification of the presence or concentration of a particular contaminant. Such mis-identifications may result in an application of the wrong treatment and/or the treatment in the wrong amount. This may result in the contaminant not being counteracted and damage to the downhole drilling assembly.

SUMMARY

In some embodiments, a method for drilling fluid management includes receiving a plurality of fluid property measurements from a drilling fluid over a period of time. A drilling fluid manager identifies an increase in a concentration of a contaminant over the period of time based on the fluid property measurements. The drilling fluid manager determines a treatment plan based on the concentration of the contaminant.

In some embodiments, a method for drilling fluid management includes measuring a first measurement of a drilling fluid property of a drilling fluid at a first time. A second measurement of the drilling fluid property is measured at a second time. A drilling fluid manager diagnoses a contaminant based on a difference between the first measurement and the second measurement. Based on the diagnosis of the contaminant, the drilling fluid manager determines a treatment plan to remedy the contaminant.

In some embodiments, a drilling system may include a drilling fluid sensor, a processor, and computer-readable media. The computer-readable media includes instructions which, when accessed by the processor, cause the processor to receive a plurality of fluid property measurements from a drilling fluid over a period of time. The drilling fluid manager may identify an increase in concentration of a contaminant over the period of time based on the fluid property measurements. The drilling fluid manager may determine a treatment plan for the contaminant based on the concentration of the contaminant.

This summary is provided to introduce a selection of concepts that are further described in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used as an aid in limiting the scope of the claimed subject matter. Additional features and aspects of embodiments of the disclosure will be set forth herein, and in part will be obvious from the description, or may be learned by the practice of such embodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to describe the manner in which the above-recited and other features of the disclosure can be obtained, a more particular description will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. For better understanding, the like elements have been designated by like reference numbers throughout the various accompanying figures. While some of the drawings may be schematic or exaggerated representations of concepts, at least some of the drawings may be drawn to scale. Understanding that the drawings depict some example embodiments, the embodiments will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:

FIG. 1 is a representation of a drilling system, according to at least one embodiment of the present disclosure;

FIG. 2 is a representation of a drilling fluid manager, according to at least one embodiment of the present disclosure;

FIG. 3 is a flowchart of a method for drilling fluid management, according to at least one embodiment of the present disclosure;

FIG. 4 is a flowchart of a method for drilling fluid management, according to at least one embodiment of the present disclosure;

FIG. 5 is a flowchart of a method for drilling fluid management, according to at least one embodiment of the present disclosure;

FIG. 6 is a flowchart of a method for drilling fluid management, according to at least one embodiment of the present disclosure;

FIG. 7 is a flowchart of a method for drilling fluid management, according to at least one embodiment of the present disclosure; and

FIG. 8 is a flowchart of a method for drilling fluid management, according to at least one embodiment of the present disclosure.

DETAILED DESCRIPTION

The particulars shown herein are by way of example and for purposes of illustrative discussion of the embodiments of the subject disclosure only and are presented in the cause of providing what is believed to be the most useful and readily understood description of the principles and conceptual aspects of the subject disclosure. In this regard, no attempt is made to show structural details in more detail than is necessary for the fundamental understanding of the subject disclosure, the description taken with the drawings making apparent to those skilled in the art how the several forms of the subject disclosure may be embodied in practice. Furthermore, like reference numbers and designations in the various drawings indicate like elements.

This disclosure generally relates to devices, systems, and methods for managing drilling fluid properties. A drilling fluid manager may receive time-series data regarding drilling fluid properties. Using the time-series data, the drilling fluid manager may diagnose the presence of one or more contaminants. The diagnosis may include a contaminant concentration. Based on the presence of the contaminant, the contaminant type, and the contaminant concentration, the drilling fluid manager may develop a treatment plan to counteract the contaminant.

In accordance with at least one embodiment of the present disclosure, the drilling fluid manager may use trends and relationships in the time-series drilling fluid measurements to diagnose the contaminant. For example, the presence and/or concentration of the contaminant may be based on a signature of the drilling fluid properties. By using the time-series information, the drilling fluid manager may increase the accuracy of the diagnosis of the contaminant. For example, the drilling fluid manager may have an increased accuracy in identifying the contaminant type and/or the contaminant concentration. This may help to improve the operation of the wellbore, reducing or preventing damage to the downhole drilling equipment.

FIG. 1 shows one example of a drilling system 100 for drilling an earth formation 101 to form a wellbore 102. The drilling system 100 includes a drill rig 103 used to turn a drilling tool assembly 104 which extends downward into the wellbore 102. The drilling tool assembly 104 may include a drill string 105, a bottomhole assembly (“BHA”) 106, and a bit 110, attached to the downhole end of the drill string 105.

The drill string 105 may include several joints of drill pipe 108 connected end-to-end through tool joints 109. The drill string 105 transmits drilling fluid through a central bore and transmits rotational power from the drill rig 103 to the BHA 106. In some embodiments, the drill string 105 may further include additional components such as subs, pup joints, etc. The drill pipe 108 provides a hydraulic passage through which drilling fluid is pumped from the surface. The drilling fluid discharges through selected-size nozzles, jets, or other orifices in the bit 110 for the purposes of cooling the bit 110 and cutting structures thereon, and for lifting cuttings out of the wellbore 102 as it is being drilled. The drilling fluid may be engineered with particular drilling fluid properties to facilitate cooling the bit 110, the cutting structures thereon, lifting cuttings out of the wellbore 102, supporting the walls of the wellbore 102, and so forth.

The drilling fluid may be stored in a mud pit 112 at a surface location 111. Drilling fluid may be drawn from the mud pit 112 and pumped into the drill string 105 using one or more mud pumps 114. As the drilling fluid flows out of the drill string 105, such as through the bit 110 or other location, the drilling fluid may carry cuttings, swarf, or other material out of the wellbore 102. The cuttings, swarf, and other material may cause a change to the properties of the drilling fluid, such as a change in density, shear stress, viscosity, and so forth. The drilling fluid may be returned to the surface location 111 at a drilling fluid return, which may be a pipe or other gathering element connected to the annulus of the wellbore 102 to collect the drilling fluid. When the drilling fluid is returned to the surface location 111, such as to the mud pit 112, the properties of the drilling fluid may be changed by the introduction of contaminants from the wellbore 102.

A measurement station 116 or sensor station may measure the properties of the drilling fluid. The measurement station 116 may measure the drilling fluid properties periodically over a period of time. As the measurement station 116 collects drilling fluid properties, a drilling fluid manager may analyze the measurements for trends. Using the analyzed trends, the drilling fluid manager may diagnose that one or more contaminants are present in the drilling fluid. In some embodiments, the drilling fluid manager may diagnose the type of contaminant. In some embodiments, the drilling fluid manager may diagnose the concentration of the contaminant. In some embodiments, the drilling fluid manager may identify when the contaminant was first detected, and the rate of increase in concentration of the contaminant.

Using the identified contaminant, the drilling fluid manager may determine a treatment plan for the contaminant. The treatment plan may include a treatment type. The treatment type may be used to neutralize or otherwise reduce the presence of the contaminant. In some embodiments, the treatment plan may include a treatment mass. The treatment mass may be an amount of treatment type that is applied to the drilling fluid to reduce the presence of the contaminant. In some embodiments, the treatment plan may further include a treatment schedule. The treatment schedule may include an application rate, or a rate at which the treatment type may be applied to reduce the presence of the contaminant. In accordance with at least one embodiment of the present disclosure, the drilling fluid manager may apply the treatment plan to the drilling fluid. For example, the drilling fluid manager may cause the treatment to be added to the drilling fluid in the mud pit 112. In some examples, the drilling fluid manager may cause the treatment to be added to the drilling fluid as it enters the drill string 105.

In some embodiments, the drilling fluid manager may determine other aspects of the treatment plan. For example, the drilling fluid manager may determine a cost of the treatment plan. In some examples, the drilling fluid manager may determine a time for the treated drilling fluid to travel through the drill string and back to the surface location 111. In some embodiments, the drilling fluid manager may determine a consequence if the treatment is not applied to the drilling fluid. For example, the drilling fluid manager may determine how long it will take for the concentration of the drilling fluid to exceed a threshold. In some examples, the drilling fluid manager may determine how long it will take until the drilling fluid properties are out of a specified range of drilling fluid properties.

The BHA 106 may include the bit 110 or other components. An example BHA 106 may include additional or other components (e.g., coupled between the drill string 105 and the bit 110). Examples of additional BHA components include drill collars, stabilizers, measurement-while-drilling (“MWD”) tools, logging-while-drilling (“LWD”) tools, downhole motors, underreamers, section mills, hydraulic disconnects, jars, vibration or dampening tools, other components, or combinations of the foregoing. The BHA 106 may further include a rotary steerable system (RSS). The RSS may include directional drilling tools that change a direction of the bit 110, and thereby the trajectory of the wellbore. At least a portion of the RSS may maintain a geostationary position relative to an absolute reference frame, such as gravity, magnetic north, and/or true north. Using measurements obtained with the geostationary position, the RSS may locate the bit 110, change the course of the bit 110, and direct the directional drilling tools on a projected trajectory.

In general, the drilling system 100 may include other drilling components and accessories, such as special valves (e.g., kelly cocks, blowout preventers, and safety valves). Additional components included in the drilling system 100 may be considered a part of the drilling tool assembly 104, the drill string 105, or a part of the BHA 106 depending on their locations in the drilling system 100.

The bit 110 in the BHA 106 may be any type of bit suitable for degrading downhole materials. For instance, the bit 110 may be a drill bit suitable for drilling the earth formation 101. Example types of drill bits used for drilling earth formations are fixed-cutter or drag bits. In other embodiments, the bit 110 may be a mill used for removing metal, composite, elastomer, other materials downhole, or combinations thereof. For instance, the bit 110 may be used with a whipstock to mill into casing 107 lining the wellbore 102. The bit 110 may also be a junk mill used to mill away tools, plugs, cement, other materials within the wellbore 102, or combinations thereof. Swarf or other cuttings formed by use of a mill may be lifted to surface or may be allowed to fall downhole.

FIG. 2 is a representation of a drilling fluid manager 218, according to at least one embodiment of the present disclosure. The drilling fluid manager 218 may include a measurement analyzer 220. The measurement analyzer 220 may receive measurements of the drilling fluid properties. In some embodiments, the measurement analyzer 220 may include one or more sensors 222. The sensors 222 may measure the drilling fluid properties. In some embodiments, the sensors 222 may include one or more rheometers. For example, the sensors 222 may include a rheometer that is used to determine the rheology of the fluid under different conditions, such as a shear rheometer and/or an extensional rheometer. In some embodiments, the sensors 222 may include a nuclear magnetic resonance (NMR) sensor, an x-ray fluorescence (XRF) sensor, a pH sensor, a laser diffraction/dynamic light scattering sensor, any other sensor, and combinations thereof.

In accordance with at least one embodiment of the present disclosure, the sensors 222 may include one or more automated sensors. The automated sensors may be located in-line sensors, or sensors placed in one or more of the pipes transporting the drilling fluid to or from the wellbore. In some embodiments, the automated sensors may collect the drilling fluid properties with minimal or no supervision by a user. For example, the automated sensors may collect the drilling fluid properties without a user collecting a sample of the drilling fluid. In some embodiments, the sensors 222 may include sensor apparatus that collect the drilling fluid properties on a user-collected drilling fluid sample.

In some embodiments, the drilling fluid properties detected by the sensors 222 may include any type of drilling fluid properties. For example, the drilling fluid properties may include pressurized density, fluid temperature during density measurement, fluid temperature during rheology measurement, plastic viscosity (PV), yield point (YP), 10 s Gel, 10 m Gel, HTHP fluid loss, solids, pH, methylene blue test (MBT), Pm, Pf, Mf, calcium Ion (Ca²⁺), total hardness (TH), chlorides (Cl), shear stress, viscosity, extensional shear, flow rate, chemical composition, suspended solids, any other type of drilling fluid property, and combinations thereof.

PV and YP involve a standard API rheology to be measured for their determination, such as measurements of a fluid at a specified temperature, usually 120° F. (49° C.), at 600, 300, 200, 100, 6 and 3 rpm using a Fann 35 rheometer or equivalent. The range of values varies by fluid system. But Table 1 below shows an example of a working signature for selected properties when contaminated. All values are in relation to the initial measurements:

TABLE 1 Anhydrite/ Property Cement Gyp Magnesium Density No change No change No change Plastic Viscosity (PV) 10% No change No change Yield Point (YP) 20% 10% −10% 10 s Gel 6 points 3 points 2 points 10 m Gel 5 points 3 points No change HTHP Fluid Loss 20% 20%  40% Solids 2% (total) No change No change pH 0.5 or more −0.5 or more No change Methylene Blue Test (MBT) No change No change No change Pm 0.4 or more −0.2 No change Pf 0.4 or more −0.4 No change Mf 0.6 or more −0.4 No change Calcium Ion (Ca 2+) 400 or more   400 or more No change Total Hardness (TH) No change No change 800 or more Chlorides (Cl2−) No change No change No change

In accordance with at least one embodiment of the present disclosure, the measurement analyzer 220 may analyze time-series data of the drilling fluid measurements. This may allow the drilling fluid manager 218 to identify trends in the measurements. In some embodiments, the time-series data may be collected over multiple minutes, hours, shifts, or days. For example, the sensors 222 may collect drilling fluid properties with a collection frequency. In some embodiments, the collection frequency may be in a range having a lower value, an upper value, or lower and upper values including any of a measurement every 1 second, 5 seconds 15 seconds, 30 seconds, 1 minute, 5 minutes, 10 minutes, 15 minutes, 30 minutes, 45 minutes, 1 hour, 2 hours, 3 hours, 4 hours, 5 hours, 6 hours, 7 hours, 8 hours, 9 hours, 10 hours, 12 hours, 18 hours, 24 hours, or any value therebetween. For example, the collection frequency may be greater than a measurement every 1 second. In another example, the collection frequency may be less than a measurement every 24 hours. In yet other examples, the collection frequency may be any value in a range between a measurement every 1 second and every 24 hours. In some embodiments, it may be critical that the collection frequency is less than a measurement every 1 hour, which may allow for analysis of the time-series data.

In some embodiments, the collection frequency is also the sampling rate of the sensors 222, meaning that the sensors 222 obtain a single measurement over the collection frequency. In other embodiments, however, the collection frequency may be different from a sampling rate of the sensors 222. For instance, any of the sensors 222 may make multiple measurements over all or a portion of the collection frequency period, and which are then used to produce a result at the collection frequency. For instance, and merely by way of illustration, a sensor 222 operating at 10 Hz may sample data over a 1-minute period every 1 hour. Thus, the sensor 222 may have a sampling rate of 10 Hz, a sampling duration of 1 minute, and a collection frequency of 1 hour, resulting in a production of 10 measurements each second, 600 measurements each minute, and 600 measurements each hour. In some embodiments, those 600 samples could be used in accordance with the methods, systems, and devices herein. In other embodiments, those 600 samples can be pre-processed to produce a reduced number of results (e.g., a single value based on an average, maximum, or minimum) that is provided or used at the collection frequency. The above example is illustrative and the collection frequency, sampling rate, and sampling duration can be varied in other examples. For instance, in one embodiment, the sampling rate may be any value or range of values between 0.000012 (1 measurement per 24 hours) and 300 Hz (300 measurements per second). The collection duration may also, in some embodiments, be any value or range of values between 1 second and 24 hours. Moreover, multiple sensors 222 may operate at different parameters, including at different collection frequencies, or at different sampling rates or sampling duration with the same or different collection frequencies.

The drilling fluid manager 218 includes a diagnosis generator 224. Using the time-series data of the drilling fluid properties, the diagnosis generator 224 may generate a diagnosis of contaminants in the drilling fluid. In some embodiments, the diagnosis generator 224 may diagnose the presence of one or more contaminant types 226. Each contaminant type 226 may have an associated signature. In some embodiments, the signature of a particular contaminant type 226 may be associated with a combination of different drilling fluid properties. In some embodiments, the signature of a particular contaminant type 226 may be associated with a change in one or more drilling fluid properties. In some embodiments, the signature of a particular contaminant type 226 may be associated with a rate of change in one or more drilling fluid properties. In some embodiments, the contaminant types 226 identified or diagnosed by the diagnosis generator may include one or more of cement, including hardened cement and green cement, anhydrite, gypsum, magnesium, salts, including halides, halites, and formates, carbonates, bicarbonates, acidic gasses, including hydrogen sulfide and carbon dioxide, low gravity solids (e.g., drilled solids), fine solids/colloidal solids, any other contaminant, and combinations thereof.

In some embodiments, the diagnosis generator 224 may diagnose a contaminant concentration 228 of a particular contaminant type 226. As discussed herein, a drilling fluid is engineered to have a particular setpoint set of drilling fluid properties. At the setpoint, the drilling fluid is configured to perform specific functions based at least partially on those drilling fluid properties, such as lubricate the bit and/or drill string, float the cuttings out of the wellbore, generate downhole power, actuate downhole drilling tools, and so forth. If the drilling fluid properties vary outside of a range from the setpoint, then the drilling fluid may not properly function. In some embodiments, this may decrease the efficiency of drilling the wellbore. In some situations, an out-of-spec drilling fluid may cause the bit and/or drill string to become stuck.

Each contaminant concentration 228 of a contaminant type 226 may have a threshold concentration. If the contaminant concentration 228 exceeds the threshold concentration, then the drilling fluid may go out of spec. In some embodiments, if the diagnosis generator 224 identifies that the contaminant concentration 228 is at or exceeds the threshold, then the drilling fluid manager 218 may generate a flag or a notice for the drilling operator. The drilling operator, upon receipt of the flag or notice, may then take action to remedy the particular contaminant type 226, such as by applying a treatment to reduce the contaminant concentration to below the threshold. In some embodiments, when the diagnosis generator 224 identifies that a particular contaminant type 226 exceeds the associated contaminant concentration 228, the drilling fluid manager 218 may take the actions to remedy the contaminant, such as by automatically applying the associated treatment.

In some embodiments, the diagnosis generator 224 may further identify a contaminant rate of change 230. The contaminant rate of change 230 may be an indication of the rate of change in contaminant concentration 228 of a particular contaminant type 226. The diagnosis generator 224 may determine the contaminant rate of change 230 based at least partially on the time-series drilling fluid properties measured and/or received by the measurement analyzer 220. For example, in some embodiments, the diagnosis generator 224 may examine different measurements of drilling fluid properties at different times. The diagnosis generator 224 may identify trends in the time-series data of the drilling fluid properties. Using those trends, the diagnosis generator may identify a contaminant rate of change 230.

In some embodiments, using the contaminant rate of change 230, the diagnosis generator 224 may extrapolate or project properties about the drilling fluid and/or the wellbore. For example, using the contaminant rate of change 230, the diagnosis generator 224 may extrapolate when the contaminant type 226 will reach or exceed the threshold contaminant concentration 228. The drilling fluid manager 218 may provide the projected concentration to a drilling operator. The drilling operator may then determine whether to apply a treatment, or when to apply a treatment to remedy the contaminant. In some embodiments, the diagnosis generator 224 may extrapolate the consequences of not remedying the contaminant type 226 based on the contaminant rate of change. For example, the diagnosis generator 224 may extrapolate that a contaminant may clog one or more ports in the BHA, bit, drill string in the wellbore. In some examples, the diagnosis generator 224 may extrapolate when drilling fluid properties may not allow the drilling fluid to float cuttings out of the wellbore. In some examples, the diagnosis generator 224 may extrapolate a time for any other consequence of the contaminant type 226 exceeding the threshold contaminant concentration. The drilling fluid manager 218 may transmit that extrapolation to a drilling operator, thereby allowing the drilling operator to plan when and if to apply a treatment to the drilling fluid.

As discussed herein, the diagnosis provided by the diagnosis generator 224 may be based at least partially on time-series data about drilling fluid properties. This may allow the drilling fluid manager to utilize trends in the change of drilling fluid properties to identify one or more of a particular contaminant type 226, a contaminant concentration 228, and a contaminant rate of change 230. Conventionally, a contaminant is identified using single measurements taken at a single point in time. This may lead to uncertainty in the contaminant type 226 and/or contaminant concentration 228. Diagnosing contaminant type 226 and contaminant concentration 228 using time-series data of drilling fluid properties may help to improve the accuracy and reliability of the diagnosis. This may help a drilling operator to swiftly and accurately respond to the presence of contaminants, thereby reducing losses due to contaminants in a wellbore.

In some embodiments, the diagnosis generator 224 may include one or more of a probability of the contaminant type 226, contaminant concentration 228, and the contaminant rate of change 230. Using field measurements, conventionally a drilling operator may have low identification accuracy of these elements. In accordance with at least one embodiment of the present disclosure, using one or more of the time-series drilling fluid properties, the accuracy of the contaminant type 226, contaminant concentration 228, and the contaminant rate of change 230 may be improved. Furthermore, the probability of the presence of a particular contaminant type 226 may be provided to the drilling operator. The drilling operator may then use the probability to determine a treatment strategy.

The drilling fluid manager 218 may further include a treatment planner 232. Using the diagnosis of the contaminant from the diagnosis generator 224, the treatment planner 232 may determine a treatment plan to reduce the amount of and in some instances neutralize, resolve, or otherwise render ineffective the contaminant. Based on the contaminant type 226, the treatment planner 232 may identify a treatment type 234. The treatment type 234 may be a particular additive that may be added to the drilling fluid. The additive may reduce the amount of and in some instances neutralize or otherwise resolve the contaminant type 226 so that the contaminant has a contaminant concentration 228 below the threshold.

The treatment plan identified by the treatment planner 232 may further include a treatment mass 236 of the treatment type 234. The treatment mass 236 may be based at least in part on the contaminant concentration 228. The treatment mass 236 may be the total amount (e.g., in lb., kg, ton, tonne,) of the treatment type 234 used to reduce the amount of and in some instances neutralize and/or resolve the contaminant. The treatment mass 236 may be based on the amount of treatment type 234 used to reduce the amount of and in some instances neutralize the contaminant type 226.

The treatment plan may further include a treatment schedule 238. The treatment schedule 238 may include a schedule for the application of the treatment type 234 to the drilling fluid. In some embodiments, the treatment schedule 238 may include a rate of addition of the treatment type 234 to the drilling fluid. For example, the treatment schedule 238 may be provided in mass per minute. In some embodiments, the treatment schedule 238 may be provided in mass per gallon of drilling fluid. In some examples, the treatment schedule 238 may provide a total duration used to apply the treatment mass 236 of the treatment type 234. In some embodiments, the treatment type 234 may, if added too fast, become a contaminant above a contaminant threshold. The treatment type 234 may be applied with the treatment schedule 238 to reduce the amount of and in some instances resolve the contaminant while not moving the drilling fluid properties out of spec itself.

Different contaminant types 226 may use different treatment types 234. In some situations, using the wrong treatment type 234 for a particular contaminant type 226 may have no effect on the drilling fluid properties. In some situations, using the wrong treatment type 234 for a particular contaminant type 226 may move the drilling fluid further out of spec. If the treatment type 234 will not neutralize or otherwise react with the contaminant type 226, the treatment type 234 may cause a different change in the drilling fluid properties, thereby causing the drilling fluid to move out of spec and creating a bigger problem to resolve.

In some embodiments, the treatment plan generated by the treatment planner 232 may be based on the time-series drilling fluid properties used in the diagnosis. For example, the treatment plan may incorporate the contaminant rate of change 230. The treatment planner 232 may identify the contaminant rate of change 230 and develop a total treatment mass 236 and/or treatment schedule 238 to reduce the amount of and in some instances resolve the contaminant, while incorporating the increase in contaminant concentration 228 during the time it takes to implement the treatment plan. In this manner, the time-series drilling fluid data may help to improve the accuracy and/or efficacy of the treatment plan.

In some embodiments, the drilling fluid manager 218 may include a cost estimator 240. In some embodiments, the cost estimator 240 may receive the treatment plan from the treatment planner 232 and determine a total cost to implement the treatment plan. The cost to implement the treatment plan may include the cost of the treatment mass 236, the cost of labor, the equipment cost, and any other associated costs, and combinations thereof. In some embodiments, the cost estimator 240 may provide an estimate of the cost not to implement the treatment plan. For example, the cost estimator 240 may receive the projected information time for the drilling fluid to move out of spec. The cost estimator 240 may determine a probability of a negative effect due to the drilling fluid being out of spec, and a cost of the negative effect. The cost estimator 240 may then assign a cost of not implementing the treatment plan. The drilling operator may use the cost estimates to determine whether to implement the treatment plan.

In some embodiments, multiple treatment types 234 are available for a single contaminant concentration 228. The treatment planner 232 may generate a treatment plan for each of the treatment types 234. The treatment planner 232 may further include an estimated effectiveness of each developed treatment plans. The cost estimator 240 may include a cost estimate for each of the treatment types 234. This may allow a drilling operator to examine the costs associated with the treatment plans and incorporate the cost estimate into the selection of the treatment plan.

The drilling fluid manager 218 may further include a treatment manager 242. In accordance with at least one embodiment of the present disclosure, the treatment manager 242 may implement the treatment plan. For example, the treatment manager 242 may include one or more storage tanks of each of the available treatment types 234. In some embodiments, based on a particular diagnosis and the associated treatment plan, the treatment manager 242 may cause the storage tanks to add the treatment mass 236 of the treatment type 234 according to the treatment schedule 238 to the drilling fluid. In some embodiments, the treatment manager 242 may automatically implement the treatment plan. This may help to improve the accuracy and/or compliance with the treatment plan. The treatment manager 242 may further help to reduce operating costs at the wellsite by reducing the amount of personnel used to implement a particular treatment plan.

Each of the components 220-242 of the drilling fluid manager can include software, hardware, or both. For example, the components 220-242 can include one or more instructions stored on a computer-readable storage medium and executable by processors of one or more computing devices, such as a client device or server device. When executed by the one or more processors, the computer-executable instructions of the drilling fluid manager 218 can cause the computing device(s) to perform the methods described herein. Alternatively, the components 220-242 can include hardware, such as a special-purpose processing device to perform a certain function or group of functions. Alternatively, the components 220-242 of the drilling fluid manager 218 can include a combination of computer-executable instructions and hardware.

Furthermore, the components 220-242 of the drilling fluid manager 218 may, for example, be implemented as one or more operating systems, as one or more stand-alone applications, as one or more modules of an application, as one or more plug-ins, as one or more library functions or functions that may be called by other applications, as a cloud-computing model, or combinations thereof. Thus, the components 220-242 may be implemented as a stand-alone application, such as a desktop or mobile application. Furthermore, the components 220-242 may be implemented as one or more web-based applications hosted on a remote server. The components 220-242 may also be implemented in a suite of mobile device applications or “apps.”

Embodiments within the scope of the present disclosure also include physical and other computer-readable media for carrying or storing computer-executable instructions and/or data structures, including applications, tables, data, libraries, or other modules used to execute particular functions or direct selection or execution of other modules. Such computer-readable media can be any available media that can be accessed by a general purpose or special purpose computer system. Computer-readable media that store computer-executable instructions (or software instructions) are physical storage media. Computer-readable media that carry computer-executable instructions are transmission media. Thus, by way of example, and not limitation, embodiments of the present disclosure can include at least two distinctly different kinds of computer-readable media, namely physical storage media or transmission media. Combinations of physical storage media and transmission media should also be included within the scope of computer-readable media.

Both physical storage media and transmission media may be used to store or carry, software instructions temporarily in the form of computer readable program code that allows performance of embodiments of the present disclosure. Physical storage media may further be used to store such software instructions in a persistent or permanent manner. Examples of physical storage media include physical memory (e.g., RAM, ROM, EPROM, EEPROM, etc.), optical disk storage (e.g., CD, DVD, HDDVD, Blu-ray, etc.), storage devices (e.g., magnetic disk storage, tape storage, diskette, etc.), flash or other solid-state storage or memory, or any other non-transmission medium which can be used to store program code in the form of computer executable instructions or data structures and which can be accessed by a general purpose or special purpose computer, whether such program code is stored as or in software, hardware, firmware, or combinations thereof.

FIGS. 3-8 , the corresponding text, and the examples below provide a number of different methods, systems, devices, and computer-readable media of the drilling fluid manager. In addition to the foregoing, one or more embodiments can also be described in terms of flowcharts comprising acts for accomplishing a particular result, as shown in FIG. 3 . FIG. 3 may be performed with more or fewer acts. Further, the acts may be performed in differing orders. Additionally, the acts described herein may be repeated or performed in parallel with one another or parallel with different instances of the same or similar acts.

As mentioned, FIG. 3 illustrates a flowchart of a series of acts for a method 344 for drilling fluid management in accordance with one or more embodiments. While FIG. 3 illustrates acts according to one embodiment, alternative embodiments may omit, add to, reorder, and/or modify any of the acts shown in FIG. 3 . The acts of FIG. 3 can be performed as part of a method. Alternatively, a computer-readable medium can comprise instructions that, when executed by one or more processors, cause a computing device to perform the acts of FIG. 3 . In some embodiments, a system can perform the acts of FIG. 3 .

In the embodiment shown in FIG. 3 , a drilling fluid manager may receive a first measurement of a drilling fluid property at a first time at 346. The drilling fluid manager may receive a second measurement of a drilling fluid property at a second time at 348. Using the first measurement and the second measurement, the drilling fluid manager may diagnose a contaminant in the drilling fluid at 350. In some embodiments, the drilling fluid manager may use a difference between the first measurement and the second measurement to identify a contaminant type and a contaminant concentration. As discussed herein, the first measurement and the second measurement may be measured at different times, creating a time-series drilling fluid property data set. The drilling fluid manager may diagnose the contaminant based on the time-series drilling fluid property set. In some embodiments, using the time-series data set, the drilling fluid manager may project or determine the contaminant at a future time. In this manner, the time-series data may allow the drilling fluid manager to generate more accurate diagnoses of the contaminant by tracking changes or trends in the change of drilling fluid properties. This may allow a drilling operator to more swiftly and more accurately identify and resolve contaminants, thereby improving wellbore productivity.

While two measurements are described herein, it should be understood that any number of measurements may be used to create the time-series data set of drilling fluid properties. For example, the drilling fluid manager may measure a third measurement of the drilling fluid property at a third time. The diagnosis of the contaminant may be based on the difference between the first measurement and the second measurement, the second measurement and the third measurement, or the first measurement and the third measurement, or a combination of all three differences.

In some embodiments, the drilling fluid manager may use the diagnosis to determine a treatment plan to neutralize or resolve the contaminant. The treatment plan may include one or more of a treatment type, a treatment mass, and a treatment schedule. In some embodiments, the treatment plan may be based on the time-series data. The drilling fluid manager may develop the treatment plan for the contaminant as diagnosed at the time of the most recent measurement and for a projection of the contaminant at a future time. This may help to improve the effectiveness of the treatment plan.

As mentioned, FIG. 4 illustrates a flowchart of a series of acts for a method 454 for drilling fluid management in accordance with one or more embodiments. While FIG. 4 illustrates acts according to one embodiment, alternative embodiments may omit, add to, reorder, and/or modify any of the acts shown in FIG. 4 . The acts of FIG. 4 can be performed as part of a method. Alternatively, a computer-readable medium can comprise instructions that, when executed by one or more processors, cause a computing device to perform the acts of FIG. 4 . In some embodiments, a system can perform the acts of FIG. 4 .

The drilling fluid manager may receive measurements of drilling fluid properties over time at 456. In some embodiments, the drilling fluid manager may receive a plurality of different measurements of different drilling fluid properties at different points in time. In some embodiments, the drilling fluid manager may receive a plurality of different measurements of the same drilling fluid property at different points in time. The drilling fluid manager may analyze the time series of drilling fluid properties at 458. The drilling fluid manager may analyze the time series to identify or flag a contaminant at 460. If a contaminant is not identified or flagged, the drilling fluid manager may continue to receive time-series data of the drilling fluid measurements. This process may be repeated until a contaminant is flagged.

When the drilling fluid manager identifies or flags a contaminant, the drilling fluid manager may determine a treatment plan to neutralize or resolve the contaminant at 462. In some embodiments, the drilling fluid manager may determine a treatment plan based on the type and concentration of the contaminant flagged. For example, a treatment type may be based on a contaminant type. A treatment mass may be based on the contaminant concentration. A treatment schedule may be based on the treatment type and the potential effect of the treatment type on the drilling fluid.

In accordance with at least one embodiment of the present disclosure, the drilling fluid manager may apply the treatment plan to the drilling fluid at 464. In some embodiments, the drilling fluid manager may automatically apply the treatment plan. For example, the drilling fluid manager may automatically add the treatment mass of the treatment type to the drilling fluid according to the treatment schedule. In some embodiments, a drilling operator may review the contaminant flag and/or the treatment plan and implement the treatment plan.

As mentioned, FIG. 5 illustrates a flowchart of a series of acts for a method 566 for drilling fluid management in accordance with one or more embodiments. While FIG. 5 illustrates acts according to one embodiment, alternative embodiments may omit, add to, reorder, and/or modify any of the acts shown in FIG. 5 . The acts of FIG. 5 can be performed as part of a method. Alternatively, a computer-readable medium can comprise instructions that, when executed by one or more processors, cause a computing device to perform the acts of FIG. 5 . In some embodiments, a system can perform the acts of FIG. 5 .

In the method 566 shown in FIG. 5 , a drilling fluid manager may receive a plurality of fluid property measurements over a period of time at 568. In some embodiments, the drilling fluid manager may receive a plurality of different measurements of different drilling fluid properties at different points in time. In some embodiments, the drilling fluid manager may receive a plurality of different measurements of the same drilling fluid property at different points in time. The drilling fluid manager may identify an increase in a concentration of a contaminant over the period of time that the drilling fluid property measurements are collected at 570. In some embodiments, as discussed herein, the drilling fluid manager may identify a rate of change of the concentration of the contaminant. The drilling fluid manager may determine at 572 whether the contaminant is above a contaminant threshold. If the contaminant is not above the contaminant threshold, then the drilling fluid manager may continue to receive the fluid property measurements over time.

If the contaminant is above the contaminant threshold, then the drilling fluid manager may determine a treatment plan at 574. In some embodiments, the drilling fluid manager may determine a treatment type, treatment concentration, and treatment schedule. In some embodiments, the drilling fluid manager may determine whether the contaminant will be above the contaminant threshold at a point in time. In some embodiments, the drilling fluid manager may determine whether the contaminant will be above the contaminant threshold before the next measurement will be taken. The drilling fluid manager may determine a treatment plan based on the predicted contaminant threshold.

As mentioned, FIG. 6 illustrates a flowchart of a series of acts for a method 676 for drilling fluid management in accordance with one or more embodiments. While FIG. 6 illustrates acts according to one embodiment, alternative embodiments may omit, add to, reorder, and/or modify any of the acts shown in FIG. 6 . The acts of FIG. 6 can be performed as part of a method. Alternatively, a computer-readable medium can comprise instructions that, when executed by one or more processors, cause a computing device to perform the acts of FIG. 6 . In some embodiments, a system can perform the acts of FIG. 6 .

In the method 676 shown in FIG. 6 , a drilling fluid manager may receive a plurality of fluid property measurements over a period of time at 678. In some embodiments, the drilling fluid manager may receive a plurality of different measurements of different drilling fluid properties at different points in time. In some embodiments, the drilling fluid manager may receive a plurality of different measurements of the same drilling fluid property at different points in time. The drilling fluid manager may identify an increase in a concentration of a contaminant over the period of time that the drilling fluid property measurements are collected at 680. In some embodiments, as discussed herein, the drilling fluid manager may identify a rate of change of the concentration of the contaminant. The drilling fluid manager may determine at 682 whether the contaminant is above a contaminant threshold. If the contaminant is not above the contaminant threshold, then the drilling fluid manager may continue to receive the fluid property measurements over time.

If the contaminant is above the threshold, then the drilling fluid manager may provide one or more options for review. For example, in the embodiment shown, the drilling fluid manager may determine a treatment plan to neutralize or resolve the treatment plan at 684. As discussed herein, the treatment plan may include a treatment type, a treatment mass, a treatment schedule, and other treatment information. In some embodiments, the drilling fluid manager may prepare multiple treatment plans. The multiple treatment plans may include different treatment types, different treatment masses, different treatment schedules, and other different treatment plans, or combinations thereof. In some embodiments, the drilling fluid manager may prepare cost estimates to implement each treatment plan.

In some embodiments, the drilling fluid manager may prepare an estimated time for implementation of the treatment plan. For example, the drilling fluid manager may estimate a return time, or the amount of time it may take for the drilling fluid to transmit through the drill string and back to the surface location. In some embodiments, the drilling fluid manager may estimate a return time for a treated fluid, or drilling fluid treated according to the treatment plan. In some examples, the drilling fluid manager may include in the time estimate the treatment schedule, or the amount of time it takes to apply the treatment mass to the drilling fluid. In some examples, the drilling fluid manager may include in the time estimate any reaction time, or amount of time for the treatment type to react with the contaminant type.

In some embodiments, the drilling fluid manager may predict one or more consequences of not treating the contamination at 686. For example, the drilling fluid manager may forecast the concentration of the contaminant at a future point in time. The drilling fluid manager may further provide a probability of a particular consequence, such as blocking one or more ports or other portions of the BHA or the bit/drill string getting stuck.

In accordance with at least one embodiment of the present disclosure, the drilling fluid manager may utilize the time-series data of the fluid property measurements to prepare the treatment plan(s) and/or the consequence(s). Using the time-series data may allow the drilling fluid manager to provide treatment plans having an increased accuracy and an increased accuracy of the consequences of a lack of treatment. In some embodiments, the drilling fluid manager may present the treatment plan(s) and the consequence(s) of no action to drilling operator. The drilling operator may review the different options and determine which action to take.

As mentioned, FIG. 7 illustrates a flowchart of a series of acts for a method 787 for drilling fluid management in accordance with one or more embodiments. While FIG. 7 illustrates acts according to one embodiment, alternative embodiments may omit, add to, reorder, and/or modify any of the acts shown in FIG. 7 . The acts of FIG. 7 can be performed as part of a method. Alternatively, a computer-readable medium can comprise instructions that, when executed by one or more processors, cause a computing device to perform the acts of FIG. 7 . In some embodiments, a system can perform the acts of FIG. 7 .

In the method 787 shown in FIG. 7 , a drilling fluid manager may receive one or more drilling fluid measurements at 788. The drilling fluid measurements may be received over a period of time. This may allow the drilling fluid manager to diagnose the presence and/or concentration of a contaminant at 789. Using the diagnosis of the contaminant, the drilling fluid manager may prescribe a treatment for the drilling fluid and/or wellbore to return the drilling fluid back to the setpoint parameters at 790. After prescribing and applying the treatment, the drilling fluid manager may assess the result of the treatment on the drilling fluid at 791. For example, the drilling fluid manager may take additional measurements of the drilling fluid to determine the change in drilling fluid properties caused by the application of the prescribed treatment.

Using the diagnosis, the prescribed treatment, and/or the results of the applied treatment, the drilling fluid manager may update the case history at 792. For example, the measurements and diagnosed treatment may be used to update the case history of the particular wellbore, of wellbores in the same or similar formations or basins, or a general case history of different wellbores in different formations or basins. The drilling fluid manager may further indicate which treatment was applied for the associated diagnosis, including treatment type, mass, and application schedule. The drilling fluid manager may further add the assessment of the result to the case history, including an indication of whether the contaminant concentration was reduced to below the threshold concentration.

A learning algorithm 793 may analyze the updated case history. Based on the case history, the learning algorithm 793 may adjust the metrics the drilling fluid manager may use to prescribe treatments for contaminants. In some embodiments, the learning algorithm 793 may adjust the metrics the drilling fluid manager may use to diagnose the contaminant.

As mentioned, FIG. 8 illustrates a flowchart of a series of acts for a method 894 for drilling fluid management in accordance with one or more embodiments. While FIG. 8 illustrates acts according to one embodiment, alternative embodiments may omit, add to, reorder, and/or modify any of the acts shown in FIG. 8 . The acts of FIG. 8 can be performed as part of a method. Alternatively, a computer-readable medium can comprise instructions that, when executed by one or more processors, cause a computing device to perform the acts of FIG. 8 . In some embodiments, a system can perform the acts of FIG. 8 .

In the method 894 shown in FIG. 8 , a drilling fluid manager may receive drilling fluid measurements at 895. The drilling fluid manager may analyze the case history of the wellbore, similar wellbores in the area, drilling fluids having similar compositions, any other wellbores or drilling fluids in the case history, and combinations thereof. In the example shown, an analysis of the case history shows that the measured drilling fluid conditions are associated with cement in 82% of similar cases at 896 and with anhydrite in 11% of similar cases at 897.

Then based on the case history, the drilling fluid manager may diagnose the drilling fluid as having a probable cement contaminant at 898. The drilling fluid manager may then recommend a treatment plan for cement at 899. As may be seen in this example, the drilling fluid manager may determine that similar drilling fluid measurements are often associated with cement, and therefore may recommend a cement treatment. In this manner, the drilling fluid manager may recommend treatments that are more reflective of the actual contaminant in the drilling fluid.

The embodiments of the drilling fluid manager have been primarily described with reference to wellbore drilling operations; however, the drilling fluid manager described herein may be used in applications other than the drilling of a wellbore. In other embodiments, drilling fluid managers according to the present disclosure may be used outside a wellbore or other downhole environment used for the exploration or production of natural resources. For instance, drilling fluid managers of the present disclosure may be used in a borehole used for placement of utility lines or in manufacturing applications utilizing cooling fluids for machining operations. Accordingly, the terms “wellbore,” “borehole” and the like should not be interpreted to limit tools, systems, assemblies, or methods of the present disclosure to any particular industry, field, or environment.

One or more specific embodiments of the present disclosure are described herein. These described embodiments are examples of the presently disclosed techniques. Additionally, in an effort to provide a concise description of these embodiments, not all features of an actual embodiment may be described in the specification. It should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous embodiment-specific decisions will be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one embodiment to another. Moreover, it should be appreciated that such a development effort might be complex and time consuming, but would nevertheless be a routine undertaking of design, fabrication, and manufacture for those of ordinary skill having the benefit of this disclosure.

Additionally, it should be understood that references to “one embodiment” or “an embodiment” of the present disclosure are not intended to be interpreted as excluding the existence of additional embodiments that also incorporate the recited features. For example, any element described in relation to an embodiment herein may be combinable with any element of any other embodiment described herein. Numbers, percentages, ratios, or other values stated herein are intended to include that value, and also other values that are “about” or “approximately” the stated value, as would be appreciated by one of ordinary skill in the art encompassed by embodiments of the present disclosure. A stated value should therefore be interpreted broadly enough to encompass values that are at least close enough to the stated value to perform a desired function or achieve a desired result. The stated values include at least the variation to be expected in a suitable manufacturing or production process, and may include values that are within 5%, within 1%, within 0.1%, or within 0.01% of a stated value.

A person having ordinary skill in the art should realize in view of the present disclosure that equivalent constructions do not depart from the spirit and scope of the present disclosure, and that various changes, substitutions, and alterations may be made to embodiments disclosed herein without departing from the spirit and scope of the present disclosure. Equivalent constructions, including functional “means-plus-function” clauses are intended to cover the structures described herein as performing the recited function, including both structural equivalents that operate in the same manner, and equivalent structures that provide the same function. It is the express intention of the applicant not to invoke means-plus-function or other functional claiming for any claim except for those in which the words ‘means for’ appear together with an associated function. Each addition, deletion, and modification to the embodiments that falls within the meaning and scope of the claims is to be embraced by the claims.

The terms “approximately,” “about,” and “substantially” as used herein represent an amount close to the stated amount that is within standard manufacturing or process tolerances, or which still performs a desired function or achieves a desired result. For example, the terms “approximately,” “about,” and “substantially” may refer to an amount that is within less than 5% of, within less than 1% of, within less than 0.1% of, and within less than 0.01% of a stated amount. Further, it should be understood that any directions or reference frames in the preceding description are merely relative directions or movements. For example, any references to “up” and “down” or “above” or “below” are merely descriptive of the relative position or movement of the related elements.

The present disclosure may be embodied in other specific forms without departing from its spirit or characteristics. The described embodiments are to be considered as illustrative and not restrictive. The scope of the disclosure is, therefore, indicated by the appended claims rather than by the foregoing description. Changes that come within the meaning and range of equivalency of the claims are to be embraced within their scope.

Although only a few example embodiments have been described in detail above, those skilled in the art will readily appreciate that many modifications are possible in the example embodiments without materially departing from this invention. Accordingly, all such modifications are intended to be included within the scope of this disclosure as defined in the following claims. In the claims, means-plus-function clauses are intended to cover the structures described herein as performing the recited function and not only structural equivalents, but also equivalent structures. Thus, although a nail and a screw may not be structural equivalents in that a nail employs a cylindrical surface to secure wooden parts together, whereas a screw employs a helical surface, in the environment of fastening wooden parts, a nail and a screw may be equivalent structures. It is the express intention of the applicant not to invoke 35 U.S.C. § 112, paragraph 6 for any limitations of any of the claims herein, except for those in which the claim expressly uses the words ‘means for’ together with an associated function. 

What is claimed is:
 1. A method for drilling fluid management, comprising: receiving a plurality of fluid property measurements of a drilling fluid over a period of time; identifying an increase in concentration of a contaminant over the period of time based on one or more of the plurality of fluid property measurements; and determining a treatment plan for the contaminant based on the concentration of the contaminant.
 2. The method of claim 1, further comprising: applying the treatment plan to the drilling fluid.
 3. The method of claim 1, wherein receiving the plurality of fluid property measurements includes receiving the plurality of fluid property measurements from a drilling fluid return.
 4. The method of claim 1, wherein receiving the plurality of fluid property measurements includes receiving different fluid property measurements at a time.
 5. The method of claim 1, wherein a collection frequency of the plurality of fluid property measurements is a measurement every one to five minutes.
 6. The method of claim 1, wherein determining the treatment plan includes determining a treatment type.
 7. The method of claim 6, wherein determining the treatment plan includes determining at least one of a treatment mass of the treatment type or a treatment schedule of the treatment type.
 8. The method of claim 6, wherein determining the treatment plan includes determining a return time for a treated fluid treated according to the treatment plan.
 9. The method of claim 1, wherein identifying the increase in the concentration of the contaminant includes identifying a rate of increase in the concentration of the contaminant.
 10. A method for drilling fluid management, comprising: measuring a first measurement of a drilling fluid property of a drilling fluid at a first time; measuring a second measurement of the drilling fluid property at a second time; diagnosing a contaminant based on a difference between the first measurement and the second measurement; and based on the diagnosis of the contaminant, determining a treatment plan to remedy the contaminant.
 11. The method of claim 10, further comprising: applying the treatment plan to the drilling fluid.
 12. The method of claim 10, further comprising: measuring a third measurement of the drilling fluid property at a third time, wherein the difference is a first difference, and wherein diagnosing the contaminant is based on at least one of the first difference, a second difference between the first measurement and the third measurement, or a third difference between the second measurement and the third measurement.
 13. The method of claim 12, further comprising: determining a rate of change of a concentration of the contaminant; and based on the rate of change, determining a duration before the concentration of the contaminant increases above a threshold concentration.
 14. The method of claim 10, wherein diagnosing the contaminant includes determining a probability of a contaminant type.
 15. The method of claim 10, wherein diagnosing the contaminant includes identifying a contaminant type and a contaminant concentration.
 16. The method of claim 15, wherein determining the treatment plan includes determining a treatment type and a treatment mass based on the contaminant type and the contaminant concentration.
 17. A system, comprising: a sensor; a processor; and computer-readable media, the computer-readable media including instructions which, when accessed by the processor, cause the processor to: receive a plurality of fluid property measurements of a drilling fluid over a period of time; identify an increase in concentration of a contaminant over the period of time based on the fluid property measurements; and determine a treatment plan for the contaminant based on the concentration of the contaminant.
 18. The system of claim 17, wherein the sensor includes a rheometer.
 19. The system of claim 17, wherein the sensor is located in-line in one or more pipes transporting drilling fluid to a drill string.
 20. The system of claim 17, wherein the sensor has a collection frequency of at least a measurement every hour. 